/*
 ============================================================================
 Page	     : 351
 Name        : starsrch.c
 Date	     : 20210406
 Author      : Hbue 18060333
 Copyright   : Your copyright notice
 Description : 使用strncmp()
 ============================================================================
 */

#include <stdio.h>
#include <string.h>
#define LISTSIZE 6

int main(void)
{
	const char *list[LISTSIZE] =
	{
			"astronomy", "astounding",
			"astrophysics", "ostracize",
			"asterism", "astrophobia"
	};

	int count = 0;

	for(int i = 0; i < LISTSIZE; i++)
	{
		if(strncmp(list[i], "astro", 5) == 0)
		{
			printf("Found: %s\n", list[i]);
			count++;
		}
	}

	printf("The list contained %d words beginning" " with astro.\n", count);

	return 0;
}

